{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "c3278656-a145-477b-baee-9b06fe1b5b8b",
   "metadata": {},
   "outputs": [],
   "source": [
    "import polars as pl\n",
    "from perspective.widget import PerspectiveWidget"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "417b2b73-72e8-4a29-9100-b260aaaaa339",
   "metadata": {},
   "outputs": [],
   "source": [
    "d1 = pl.read_parquet(\"new_share.parquet\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "e4d337c6-514c-49e5-8b8a-f31d8920784e",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(2000, 12)"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "d1.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "03607f8c-f86e-4fa9-ac43-a4d3c5f128c5",
   "metadata": {},
   "outputs": [],
   "source": [
    "d2 = pl.read_parquet(\"stock_basic.parquet\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "31d360f1-7461-4a7d-ac78-48ed4dbff2e5",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(5415, 17)"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "d2.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "d4fed0c9-2740-4ea3-9830-0cb5234fb4d0",
   "metadata": {},
   "outputs": [],
   "source": [
    "d1 = d1.with_columns(\n",
    "    ipo_date=pl.col.ipo_date.str.to_date(\"%Y%m%d\"),\n",
    "    issue_date=pl.col.issue_date.str.to_date(\"%Y%m%d\"),\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "5e084d70-c818-48f2-8e31-8b350476f0c6",
   "metadata": {},
   "outputs": [],
   "source": [
    "d2 = d2.with_columns(\n",
    "    list_date=pl.col.list_date.str.to_date(\"%Y%m%d\"),\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "1107343e-a72f-4f68-8b6c-0bb7ec8ee6b9",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "polars.dataframe.frame.DataFrame"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "type(d1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "5edcb7e8-3b67-4948-9550-5cec9571b135",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "polars.dataframe.frame.DataFrame"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "type(d2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "0acb5bbb-cc9e-41b7-b353-6fd3dca3b098",
   "metadata": {},
   "outputs": [],
   "source": [
    "config = '{\"version\":\"3.6.0\",\"plugin\":\"Datagrid\",\"plugin_config\":{\"columns\":{},\"edit_mode\":\"READ_ONLY\",\"scroll_lock\":false},\"columns_config\":{\"market_amount\":{\"number_format\":{\"minimumFractionDigits\":0.0,\"maximumFractionDigits\":2.0}},\"price\":{\"number_bg_mode\":\"gradient\",\"bg_gradient\":557.8},\"price_cent\":{\"number_format\":{\"style\":\"currency\",\"currency\":\"CNY\",\"minimumFractionDigits\":0.0,\"maximumFractionDigits\":2.0}},\"name\":{\"format\":\"bold\",\"string_color_mode\":\"foreground\"},\"上网发行比例\":{\"number_bg_mode\":\"gradient\",\"bg_gradient\":1.0,\"number_format\":{\"style\":\"percent\",\"minimumFractionDigits\":2.0,\"maximumFractionDigits\":2.0}},\"amount\":{\"number_format\":{\"minimumFractionDigits\":0.0,\"maximumFractionDigits\":2.0}}},\"settings\":true,\"theme\":\"Pro Light\",\"title\":null,\"group_by\":[],\"split_by\":[],\"sort\":[],\"filter\":[],\"expressions\":{\"price_cent\":\"\\\"price\\\" * 100\",\"上网发行比例\":\"\\\"market_amount\\\" / \\\"amount\\\"\"},\"columns\":[\"ts_code\",\"sub_code\",\"name\",\"ipo_date\",\"issue_date\",\"amount\",\"market_amount\",\"上网发行比例\",\"price\",\"price_cent\",\"pe\",\"limit_amount\",\"funds\",\"ballot\"],\"aggregates\":{}}'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "478ddbf8-b029-44cb-bdad-1865e98dc992",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{\"version\":\"3.6.0\",\"plugin\":\"Datagrid\",\"plugin_config\":{\"columns\":{},\"edit_mode\":\"READ_ONLY\",\"scroll_lock\":false},\"columns_config\":{\"market_amount\":{\"number_format\":{\"minimumFractionDigits\":0.0,\"maximumFractionDigits\":2.0}},\"price\":{\"number_bg_mode\":\"gradient\",\"bg_gradient\":557.8},\"price_cent\":{\"number_format\":{\"style\":\"currency\",\"currency\":\"CNY\",\"minimumFractionDigits\":0.0,\"maximumFractionDigits\":2.0}},\"name\":{\"format\":\"bold\",\"string_color_mode\":\"foreground\"},\"上网发行比例\":{\"number_bg_mode\":\"gradient\",\"bg_gradient\":1.0,\"number_format\":{\"style\":\"percent\",\"minimumFractionDigits\":2.0,\"maximumFractionDigits\":2.0}},\"amount\":{\"number_format\":{\"minimumFractionDigits\":0.0,\"maximumFractionDigits\":2.0}}},\"settings\":true,\"theme\":\"Pro Light\",\"title\":null,\"group_by\":[],\"split_by\":[],\"sort\":[],\"filter\":[],\"expressions\":{\"price_cent\":\"\"price\" * 100\",\"上网发行比例\":\"\"market_amount\" / \"amount\"\"},\"columns\":[\"ts_code\",\"sub_code\",\"name\",\"ipo_date\",\"issue_date\",\"amount\",\"market_amount\",\"上网发行比例\",\"price\",\"price_cent\",\"pe\",\"limit_amount\",\"funds\",\"ballot\"],\"aggregates\":{}}\n"
     ]
    }
   ],
   "source": [
    "print(config)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "fe83bd6e-d7cf-4fdc-8c74-0a817f3f7f7c",
   "metadata": {},
   "outputs": [],
   "source": [
    "from pathlib import Path"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "eb133689-a2c9-4eca-87c5-ab831d78cb33",
   "metadata": {},
   "outputs": [],
   "source": [
    "config2 = Path(\"C:/Users/PC/Downloads/untitled.config.json\").read_text(encoding=\"utf8\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "77b98596-656d-4546-bb15-48080aac403b",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{\"version\":\"3.6.0\",\"plugin\":\"Datagrid\",\"plugin_config\":{\"columns\":{},\"edit_mode\":\"READ_ONLY\",\"scroll_lock\":false},\"columns_config\":{\"market_amount\":{\"number_format\":{\"minimumFractionDigits\":0.0,\"maximumFractionDigits\":2.0}},\"price\":{\"number_bg_mode\":\"gradient\",\"bg_gradient\":557.8},\"price_cent\":{\"number_format\":{\"style\":\"currency\",\"currency\":\"CNY\",\"minimumFractionDigits\":0.0,\"maximumFractionDigits\":2.0}},\"name\":{\"format\":\"bold\",\"string_color_mode\":\"foreground\"},\"上网发行比例\":{\"number_bg_mode\":\"gradient\",\"bg_gradient\":1.0,\"number_format\":{\"style\":\"percent\",\"minimumFractionDigits\":2.0,\"maximumFractionDigits\":2.0}},\"amount\":{\"number_format\":{\"minimumFractionDigits\":0.0,\"maximumFractionDigits\":2.0}}},\"settings\":true,\"theme\":\"Pro Light\",\"title\":null,\"group_by\":[],\"split_by\":[],\"sort\":[],\"filter\":[],\"expressions\":{\"price_cent\":\"\\\"price\\\" * 100\",\"上网发行比例\":\"\\\"market_amount\\\" / \\\"amount\\\"\"},\"columns\":[\"ts_code\",\"sub_code\",\"name\",\"ipo_date\",\"issue_date\",\"amount\",\"market_amount\",\"上网发行比例\",\"price\",\"price_cent\",\"pe\",\"limit_amount\",\"funds\",\"ballot\"],\"aggregates\":{}}\n"
     ]
    }
   ],
   "source": [
    "print(config2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "id": "4aecd668-b308-47ed-b8b0-650f5e2860c0",
   "metadata": {},
   "outputs": [],
   "source": [
    "import json"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "id": "6ddd207a-9f67-4d5f-8388-fbc29d2a360d",
   "metadata": {},
   "outputs": [],
   "source": [
    "d = json.loads(config2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "id": "c0b760c2-48d8-4138-934c-2d8eca48549b",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'version': '3.6.0',\n",
       " 'plugin': 'Datagrid',\n",
       " 'plugin_config': {'columns': {},\n",
       "  'edit_mode': 'READ_ONLY',\n",
       "  'scroll_lock': False},\n",
       " 'columns_config': {'market_amount': {'number_format': {'minimumFractionDigits': 0.0,\n",
       "    'maximumFractionDigits': 2.0}},\n",
       "  'price': {'number_bg_mode': 'gradient', 'bg_gradient': 557.8},\n",
       "  'price_cent': {'number_format': {'style': 'currency',\n",
       "    'currency': 'CNY',\n",
       "    'minimumFractionDigits': 0.0,\n",
       "    'maximumFractionDigits': 2.0}},\n",
       "  'name': {'format': 'bold', 'string_color_mode': 'foreground'},\n",
       "  '上网发行比例': {'number_bg_mode': 'gradient',\n",
       "   'bg_gradient': 1.0,\n",
       "   'number_format': {'style': 'percent',\n",
       "    'minimumFractionDigits': 2.0,\n",
       "    'maximumFractionDigits': 2.0}},\n",
       "  'amount': {'number_format': {'minimumFractionDigits': 0.0,\n",
       "    'maximumFractionDigits': 2.0}}},\n",
       " 'settings': True,\n",
       " 'theme': 'Pro Light',\n",
       " 'title': None,\n",
       " 'group_by': [],\n",
       " 'split_by': [],\n",
       " 'sort': [],\n",
       " 'filter': [],\n",
       " 'expressions': {'price_cent': '\"price\" * 100',\n",
       "  '上网发行比例': '\"market_amount\" / \"amount\"'},\n",
       " 'columns': ['ts_code',\n",
       "  'sub_code',\n",
       "  'name',\n",
       "  'ipo_date',\n",
       "  'issue_date',\n",
       "  'amount',\n",
       "  'market_amount',\n",
       "  '上网发行比例',\n",
       "  'price',\n",
       "  'price_cent',\n",
       "  'pe',\n",
       "  'limit_amount',\n",
       "  'funds',\n",
       "  'ballot'],\n",
       " 'aggregates': {}}"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "d"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "id": "b523f4e7-ae3c-4593-8064-763eedca3fe2",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "dict"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "type(d)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "id": "97f6151e-1faa-4633-acf3-6684db67e829",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'number_format': {'minimumFractionDigits': 0.0, 'maximumFractionDigits': 2.0}}"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "d[\"columns_config\"][\"market_amount\"]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "id": "19d7edb1-fcd8-4219-b477-0ec2ee763e3b",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "bd641aad06fd46b997feab1c27dfe5ef",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "PerspectiveWidget(binding_mode='server', columns=['ts_code', 'sub_code', 'name', 'ipo_date', 'issue_date', 'am…"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "PerspectiveWidget(\n",
    "    d1, \n",
    "    expressions={\n",
    "        'price_cent': '\"price\" * 100',\n",
    "        '上网发行比例': '\"market_amount\" / \"amount\"',\n",
    "    }\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "id": "2b29e4a4-14eb-4337-a6a8-ed342d7f1fb4",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "62f3b883643c4f18bd9b4804f1311d45",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "PerspectiveWidget(binding_mode='server', columns=['ts_code', 'symbol', 'name', 'area', 'industry', 'fullname',…"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "PerspectiveWidget(d2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "id": "30324e57-e6f9-4c37-b3db-f75ba7ee3a20",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div><style>\n",
       ".dataframe > thead > tr,\n",
       ".dataframe > tbody > tr {\n",
       "  text-align: right;\n",
       "  white-space: pre-wrap;\n",
       "}\n",
       "</style>\n",
       "<small>shape: (2_000, 28)</small><table border=\"1\" class=\"dataframe\"><thead><tr><th>ts_code</th><th>sub_code</th><th>name</th><th>ipo_date</th><th>issue_date</th><th>amount</th><th>market_amount</th><th>price</th><th>pe</th><th>limit_amount</th><th>funds</th><th>ballot</th><th>symbol</th><th>name_right</th><th>area</th><th>industry</th><th>fullname</th><th>enname</th><th>cnspell</th><th>market</th><th>exchange</th><th>curr_type</th><th>list_status</th><th>list_date</th><th>delist_date</th><th>is_hs</th><th>act_name</th><th>act_ent_type</th></tr><tr><td>str</td><td>str</td><td>str</td><td>date</td><td>date</td><td>f64</td><td>f64</td><td>f64</td><td>f64</td><td>f64</td><td>f64</td><td>f64</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>date</td><td>null</td><td>str</td><td>str</td><td>str</td></tr></thead><tbody><tr><td>&quot;603014.SH&quot;</td><td>&quot;732014&quot;</td><td>&quot;威高血净&quot;</td><td>2025-05-08</td><td>null</td><td>4114.0</td><td>0.0</td><td>0.0</td><td>0.0</td><td>1.1</td><td>0.0</td><td>0.0</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td></tr><tr><td>&quot;301595.SZ&quot;</td><td>&quot;301595&quot;</td><td>&quot;太力科技&quot;</td><td>2025-05-08</td><td>null</td><td>2707.0</td><td>0.0</td><td>0.0</td><td>0.0</td><td>0.65</td><td>0.0</td><td>0.0</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td></tr><tr><td>&quot;688755.SH&quot;</td><td>&quot;787755&quot;</td><td>&quot;汉邦科技&quot;</td><td>2025-05-07</td><td>null</td><td>2200.0</td><td>0.0</td><td>0.0</td><td>0.0</td><td>0.5</td><td>0.0</td><td>0.0</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td></tr><tr><td>&quot;301636.SZ&quot;</td><td>&quot;301636&quot;</td><td>&quot;泽润新能&quot;</td><td>2025-04-28</td><td>null</td><td>1597.0</td><td>455.0</td><td>33.06</td><td>17.57</td><td>0.45</td><td>5.279</td><td>0.0</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td></tr><tr><td>&quot;920068.BJ&quot;</td><td>&quot;920068&quot;</td><td>&quot;天工股份&quot;</td><td>2025-04-28</td><td>null</td><td>6000.0</td><td>4200.0</td><td>3.94</td><td>14.98</td><td>255.0</td><td>2.364</td><td>0.0</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td></tr><tr><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td></tr><tr><td>&quot;300777.SZ&quot;</td><td>&quot;300777&quot;</td><td>&quot;中简科技&quot;</td><td>2019-05-06</td><td>2019-05-16</td><td>4001.0</td><td>3601.0</td><td>6.06</td><td>22.98</td><td>1.1</td><td>2.425</td><td>0.04</td><td>&quot;300777&quot;</td><td>&quot;中简科技&quot;</td><td>&quot;江苏&quot;</td><td>&quot;化纤&quot;</td><td>&quot;中简科技股份有限公司&quot;</td><td>&quot;Sinofibers Technology Co.,Ltd.&quot;</td><td>&quot;zjkj&quot;</td><td>&quot;创业板&quot;</td><td>&quot;SZSE&quot;</td><td>&quot;CNY&quot;</td><td>&quot;L&quot;</td><td>2019-05-16</td><td>null</td><td>&quot;S&quot;</td><td>null</td><td>null</td></tr><tr><td>&quot;603267.SH&quot;</td><td>&quot;732267&quot;</td><td>&quot;鸿远电子&quot;</td><td>2019-04-30</td><td>2019-05-15</td><td>4134.0</td><td>3721.0</td><td>20.24</td><td>16.5</td><td>1.6</td><td>8.367</td><td>0.03</td><td>&quot;603267&quot;</td><td>&quot;鸿远电子&quot;</td><td>&quot;北京&quot;</td><td>&quot;元器件&quot;</td><td>&quot;北京元六鸿远电子科技股份有限公司&quot;</td><td>&quot;Beijing Yuanliu Hongyuan Elect…</td><td>&quot;hydz&quot;</td><td>&quot;主板&quot;</td><td>&quot;SSE&quot;</td><td>&quot;CNY&quot;</td><td>&quot;L&quot;</td><td>2019-05-15</td><td>null</td><td>&quot;H&quot;</td><td>null</td><td>null</td></tr><tr><td>&quot;600989.SH&quot;</td><td>&quot;730989&quot;</td><td>&quot;宝丰能源&quot;</td><td>2019-04-30</td><td>2019-05-16</td><td>73336.0</td><td>66002.0</td><td>11.12</td><td>22.07</td><td>22.0</td><td>81.55</td><td>0.25</td><td>&quot;600989&quot;</td><td>&quot;宝丰能源&quot;</td><td>&quot;宁夏&quot;</td><td>&quot;化工原料&quot;</td><td>&quot;宁夏宝丰能源集团股份有限公司&quot;</td><td>&quot;Ningxia Baofeng Energy Group C…</td><td>&quot;bfny&quot;</td><td>&quot;主板&quot;</td><td>&quot;SSE&quot;</td><td>&quot;CNY&quot;</td><td>&quot;L&quot;</td><td>2019-05-16</td><td>null</td><td>&quot;H&quot;</td><td>null</td><td>null</td></tr><tr><td>&quot;300778.SZ&quot;</td><td>&quot;300778&quot;</td><td>&quot;新城市&quot;</td><td>2019-04-25</td><td>2019-05-10</td><td>2000.0</td><td>2000.0</td><td>27.33</td><td>22.99</td><td>2.0</td><td>5.466</td><td>0.02</td><td>&quot;300778&quot;</td><td>&quot;新城市&quot;</td><td>&quot;深圳&quot;</td><td>&quot;建筑工程&quot;</td><td>&quot;深圳市新城市规划建筑设计股份有限公司&quot;</td><td>&quot;Shenzhen New Land Tool Plannin…</td><td>&quot;xcs&quot;</td><td>&quot;创业板&quot;</td><td>&quot;SZSE&quot;</td><td>&quot;CNY&quot;</td><td>&quot;L&quot;</td><td>2019-05-10</td><td>null</td><td>&quot;N&quot;</td><td>null</td><td>null</td></tr><tr><td>&quot;002953.SZ&quot;</td><td>&quot;002953&quot;</td><td>&quot;日丰股份&quot;</td><td>2019-04-24</td><td>2019-05-09</td><td>4302.0</td><td>3872.0</td><td>10.52</td><td>16.34</td><td>1.7</td><td>4.526</td><td>0.03</td><td>&quot;002953&quot;</td><td>&quot;日丰股份&quot;</td><td>&quot;广东&quot;</td><td>&quot;电气设备&quot;</td><td>&quot;广东日丰电缆股份有限公司&quot;</td><td>&quot;Guangdong Rifeng Electric Cabl…</td><td>&quot;rfgf&quot;</td><td>&quot;主板&quot;</td><td>&quot;SZSE&quot;</td><td>&quot;CNY&quot;</td><td>&quot;L&quot;</td><td>2019-05-09</td><td>null</td><td>&quot;N&quot;</td><td>&quot;冯就景&quot;</td><td>&quot;民营企业&quot;</td></tr></tbody></table></div>"
      ],
      "text/plain": [
       "shape: (2_000, 28)\n",
       "┌───────────┬──────────┬──────────┬────────────┬───┬─────────────┬───────┬──────────┬──────────────┐\n",
       "│ ts_code   ┆ sub_code ┆ name     ┆ ipo_date   ┆ … ┆ delist_date ┆ is_hs ┆ act_name ┆ act_ent_type │\n",
       "│ ---       ┆ ---      ┆ ---      ┆ ---        ┆   ┆ ---         ┆ ---   ┆ ---      ┆ ---          │\n",
       "│ str       ┆ str      ┆ str      ┆ date       ┆   ┆ null        ┆ str   ┆ str      ┆ str          │\n",
       "╞═══════════╪══════════╪══════════╪════════════╪═══╪═════════════╪═══════╪══════════╪══════════════╡\n",
       "│ 603014.SH ┆ 732014   ┆ 威高血净 ┆ 2025-05-08 ┆ … ┆ null        ┆ null  ┆ null     ┆ null         │\n",
       "│ 301595.SZ ┆ 301595   ┆ 太力科技 ┆ 2025-05-08 ┆ … ┆ null        ┆ null  ┆ null     ┆ null         │\n",
       "│ 688755.SH ┆ 787755   ┆ 汉邦科技 ┆ 2025-05-07 ┆ … ┆ null        ┆ null  ┆ null     ┆ null         │\n",
       "│ 301636.SZ ┆ 301636   ┆ 泽润新能 ┆ 2025-04-28 ┆ … ┆ null        ┆ null  ┆ null     ┆ null         │\n",
       "│ 920068.BJ ┆ 920068   ┆ 天工股份 ┆ 2025-04-28 ┆ … ┆ null        ┆ null  ┆ null     ┆ null         │\n",
       "│ …         ┆ …        ┆ …        ┆ …          ┆ … ┆ …           ┆ …     ┆ …        ┆ …            │\n",
       "│ 300777.SZ ┆ 300777   ┆ 中简科技 ┆ 2019-05-06 ┆ … ┆ null        ┆ S     ┆ null     ┆ null         │\n",
       "│ 603267.SH ┆ 732267   ┆ 鸿远电子 ┆ 2019-04-30 ┆ … ┆ null        ┆ H     ┆ null     ┆ null         │\n",
       "│ 600989.SH ┆ 730989   ┆ 宝丰能源 ┆ 2019-04-30 ┆ … ┆ null        ┆ H     ┆ null     ┆ null         │\n",
       "│ 300778.SZ ┆ 300778   ┆ 新城市   ┆ 2019-04-25 ┆ … ┆ null        ┆ N     ┆ null     ┆ null         │\n",
       "│ 002953.SZ ┆ 002953   ┆ 日丰股份 ┆ 2019-04-24 ┆ … ┆ null        ┆ N     ┆ 冯就景   ┆ 民营企业     │\n",
       "└───────────┴──────────┴──────────┴────────────┴───┴─────────────┴───────┴──────────┴──────────────┘"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df =d1.join(d2, on=\"ts_code\", how=\"left\")\n",
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "id": "0b6d8300-9f49-4388-bbd6-e0a5946b1788",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "46705a8790a14c848589fca7131043bd",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "PerspectiveWidget(binding_mode='server', columns=['ts_code', 'sub_code', 'name', 'ipo_date', 'issue_date', 'am…"
      ]
     },
     "execution_count": 23,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "PerspectiveWidget(df)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "id": "a5ace286-8353-4054-8234-3509e74e66f2",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "be44c647edda488e97824fed0e522cd4",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "PerspectiveWidget(binding_mode='server', columns=['ts_code', 'sub_code', 'name', 'ipo_date', 'issue_date', 'am…"
      ]
     },
     "execution_count": 24,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "PerspectiveWidget(df)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "id": "a22f1982-53a0-41b7-9db8-30cb8372eccd",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "8fc6e2b1e6f94026b2192474e919fa81",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "PerspectiveWidget(binding_mode='server', columns=['ts_code', 'sub_code', 'name', 'ipo_date', 'issue_date', 'am…"
      ]
     },
     "execution_count": 26,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "PerspectiveWidget(df)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "id": "8dd5cb67-7c19-4c5b-b8d0-d966ef39e8d4",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "ee2811b14aef4ee08a5dcee3faa9b4de",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "PerspectiveWidget(binding_mode='server', columns=['ts_code', 'sub_code', 'name', 'ipo_date', 'issue_date', 'am…"
      ]
     },
     "execution_count": 27,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "PerspectiveWidget(df)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "id": "48647fdb-da8a-4952-b8e4-3fdc67286635",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "5cc2dbed70ab472285bb1be0fada36e0",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "PerspectiveWidget(binding_mode='server', columns=['ts_code', 'sub_code', 'name', 'ipo_date', 'issue_date', 'am…"
      ]
     },
     "execution_count": 28,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "PerspectiveWidget(df)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "id": "7f9447d4-461b-4cf1-b8d8-94f24d369a45",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "2190733611514764a7e521a51f6732d5",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "PerspectiveWidget(binding_mode='server', columns=['ts_code', 'sub_code', 'name', 'ipo_date', 'issue_date', 'am…"
      ]
     },
     "execution_count": 29,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "PerspectiveWidget(df)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "fb47495b-78fb-4ddf-8c10-3c5ec1e3c14a",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.12.10"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
